Skip to content

feat(esp32): throttle Wi-Fi TX during Matter BDX OTA (v1.1.5) + subscription-log ANSI fix - #84

Merged
AndrewDemsDS merged 2 commits into
mainfrom
feat/esp32-bdx-ota-throttle
Jul 22, 2026
Merged

feat(esp32): throttle Wi-Fi TX during Matter BDX OTA (v1.1.5) + subscription-log ANSI fix#84
AndrewDemsDS merged 2 commits into
mainfrom
feat/esp32-bdx-ota-throttle

Conversation

@AndrewDemsDS

Copy link
Copy Markdown
Owner

Two reliability changes for the ESP32 esp-matter node, both prompted by the node-35 phy_init brownout investigation (#83).

1. Throttle Wi-Fi TX during a Matter (BDX) OTA (feat, v1.1.5)

The #12 brownout mitigation drops Wi-Fi TX power for the concurrent flash-write + TX window of an OTA, but it only covered the HTTP break-glass path (https_ota_task). The primary Matter (BDX) OTA path ran the whole download+apply at the full 20 dBm ceiling.

  • New HisenseOTARequestorDriver : ExtendedOTARequestorDriver lowers TX on HandleIdleStateExit() (update starting) and restores on HandleIdleStateEnter() (back to idle on any path: done/abort/timeout).
  • Registered via esp_matter_ota_requestor_set_config() right after esp_matter::start() (before the async kDnssdInitialized auto-start consumes the driver).
  • Capture-once + restore-on-every-idle-enter, mirroring the HTTP path's save/restore discipline so the node never sticks at 10 dBm.
  • Reuses the existing HISENSE_OTA_TX_POWER_QDBM (10 dBm). Not a substitute for the bulk cap; it lowers brownout probability during the OTA window.
  • PROJECT_VER 1.1.4 -> 1.1.5 (int 10105).

2. Strip ANSI before the subscription-log grep (fix)

matter-server colourises its logs, so a \x1b[0m reset sits between <Node:N> and the message. The anchored <Node:N> (Re-)?Subscription succeeded pattern never matched, hard-failing check_subscription_log on otherwise-healthy flashes (node 35 v1.1.4: version confirmed, node available + subscribed, gate still errored). Strip ANSI first in both esp32-release.sh and ota-release.sh; also bring the esp32 script up to the ameba behaviour (match Re-Subscription, tail -1 the newest, poll for the late resubscribe).

Validation

  • Built (debug flavour), delta-OTA flashed to node 35 (first attempt, clean).
  • SoftwareVersionString=1.1.5 (int 10105) sustained; re-interviewed; subscribable.
  • check_subscription_log now passes (matter-server log confirms: <Node:35> Subscription succeeded).
  • Live diagnostics: CompressorHz=63, Features1=0xC0010519 (valid), Faults1=0x80000000 (valid, no faults).
  • The TX throttle activates on the next OTA (running firmware must already carry it), so it protects v1.1.5 -> future updates.

Assisted-by: AI

matter-server colourises its logs, so a `\x1b[0m` reset sits between
'<Node:N>' and the message. The anchored '<Node:N> (Re-)?Subscription
succeeded' pattern never matched, hard-failing check_subscription_log on
otherwise-healthy flashes (node 35 v1.1.4: version confirmed, node
available + subscribed, gate still errored). Strip ANSI first in both
scripts; also bring esp32-release.sh up to the ota-release.sh behaviour
(match Re-Subscription, tail -1 the newest, poll for the late resubscribe).

Assisted-by: AI
The #12 brownout mitigation (drop TX power for the concurrent flash-write +
Wi-Fi-TX window of an OTA) only covered the HTTP break-glass path; the
PRIMARY Matter (BDX) OTA path ran at the full 20 dBm ceiling. Swap in a
HisenseOTARequestorDriver that lowers TX on idle-exit (update starting) and
restores it on idle-enter (back to idle on any path: done/abort/timeout),
registered via esp_matter_ota_requestor_set_config right after
esp_matter::start(). Capture-once + restore-on-every-idle-enter so the node
never sticks at 10 dBm. Not a substitute for the bulk cap; it lowers
brownout probability during the OTA window (node-35 phy_init brownout).

PROJECT_VER 1.1.4 -> 1.1.5 (int 10105). Built + delta-OTA flashed to node 35,
verified live: 1.1.5, subscribable, diagnostics reading (CompressorHz,
Features1/Faults1 valid).

Assisted-by: AI
@AndrewDemsDS
AndrewDemsDS merged commit 67f397c into main Jul 22, 2026
5 checks passed
@AndrewDemsDS
AndrewDemsDS deleted the feat/esp32-bdx-ota-throttle branch July 22, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant